<%@ include file="/WEB-INF/templates/jsp/include.jsp"%>
<%@ taglib prefix="basic" uri="http://ciracas.basic.org/tags-ui"%>

<script type="text/javascript">
    function doSave()
    {
        with(document.getElementById("commandCurrency"))
        {
        	action = "<%=request.getContextPath()%><spring:message code="app.url.base"/>/master/currency/saveform";
            submit();
        }
    }

    function doCancel()
    {
        with(document.getElementById("commandCurrency"))
        {
            id.value = '';
            action = "<%=request.getContextPath()%><spring:message code="app.url.base"/>/master/currency/cancelform";
			method = "GET";
			submit();
		}
	}
</script>
<div class="cssLevelTitle">
<h2><spring:message code="label.inputData" />&nbsp;<spring:message
	code="label.currency" /></h2>
</div>
<c:if test="${not empty commandCurrency.msgList}">
	<br>
	<div style="color: red; font-size: 11px; font-weight: bold;">
	<ul>
		<c:forEach items="${commandCurrency.msgList}" var="errMsg"
			varStatus="errMsgSt">
			<li>${errMsg}
		</c:forEach>
	</ul>
	</div>
</c:if>
<form:form commandName="commandCurrency" cssStyle="feedbackform"
	method="post">
	<form:hidden path="strAction" />
	<form:hidden path="id" />
	<div class="fieldwrapper">
		<label class="styled"><spring:message code="label.currabrev" /></label>
	<div class="thefield"><form:input path="currabrev" maxlength="3"
		cssErrorClass="form-error-field" /></div>
	<div class="form-error-message"><form:errors path="currabrev" /></div>
	</div>
	<div class="fieldwrapper"><label class="styled"><spring:message
		code="label.currency" /></label>
	<div class="thefield"><form:input path="currency" maxlength="30"
		cssErrorClass="form-error-field" /></div>
	<div class="form-error-message"><form:errors path="currency" /></div>
	</div>
	<div class="fieldwrapper"><label class="styled"><spring:message
		code="label.hundredsname" /></label>
	<div class="thefield"><form:input path="hundredsname"
		maxlength="15" cssErrorClass="form-error-field" /></div>
	<div class="form-error-message"><form:errors path="hundredsname" /></div>
	</div>
	<div class="fieldwrapper"><label class="styled"><spring:message
		code="label.country" /></label>
	<div class="thefield"><form:select items="${commandCurrency.countryList}"
		itemLabel="stLabel" itemValue="stValue" path="countryId"
		cssErrorClass="form-error-field" /></div>
	<div class="form-error-message"><form:errors path="countryId" /></div>
	</div>

	<div><basic:button type="button" title="button.save"
		onclick="doSave();" /> <basic:button type="reset"
		title="button.reset" /> <basic:button type="button"
		title="button.cancel" onclick="doCancel();" /></div>
</form:form>